function Page (params) {
	this.list = function (pageNum) {
		if (pageNum == null || pageNum == 'undefined') {
			pageNum = 1;
		}
		handle.sendRequest(pageNum,params);
	}
}

var handle = {
	sendRequest : function (pageNum,params) {
		$("form").ajaxSubmit({
			beforeSubmit : function(form, info, opts) {
				var data = {};
				for (var i = 0; i < form.length; i++) {
					data[form[i].name] = form[i].value;
				}
				data['pageNum'] = pageNum;
				$.ajax({
					type : "POST",  //提交方式
					url : opts.url,//路径
					data : data,//数据，这里使用的是Json格式进行传输
					success : function(result) {//返回数据根据结果进行相应的处理
						handle.loadData(result.data,params);
					}
				});
			}
		});
	},

	loadData : function (data,params) {
		var columns = params.columns;
		var id = params.ID;
		var $table = $(id);
		var thead = "<thead><tr><th><input type='checkbox' name='' value=''></th>";
		for (var i = 0;i < columns.length;i++) {
			var name = columns[i].name;
			thead += "<th>"+ name +"</th>";
		}
		thead += "</tr></thead>";
		$table.append(thead);
		$table.append("<tbody></tbody>");
		var $tbody = $table.find("tbody");
		$tbody.find("tr").remove();
		$.each(data, function(i, item) {
			var tr = "<tr>";
			for (var i = 0;i < columns.length;i++) {
				var field = columns[i].field;
				if(field == 'operator'){
					item[field] = params.operator;
				}else{
					var parseTextValue = params.textHandel(nam,item[field]);
					if(parseTextValue != null && parseTextValue != ''){
						item[field] = parseTextValue;
					}
				}
				tr += "<td>"+ item[field]+ "</td>";
			}
			tr += "</tr>";
			$tbody.append(tr);
		});
	}
};